package com.base;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author yijy
 * @description
 * @create 2021/3/16 下午2:16
 **/
public class TestSync {

    public static void main(String[] args) {
        new TestSync().test();
    }

    public void test(){
        for(int i=0; i< 20; i++){
            Object obj = i%2;
            Thread thread = new Thread(() ->{
                System.out.println(Thread.currentThread().getName()+": " + obj);
            });
            thread.setDaemon(false);
            thread.start();
        }
    }
}
